using System.Diagnostics;
using data.contracts;
using generator.Properties;

namespace generator
{
    public static class BoardGenerator
    {
        public static string Generate(Board board) {
            Trace.TraceInformation("Generate board {0}", board.Name);
            return Resources.BoardTemplate
                .Replace("$namespace$", board.Namespace)
                .Replace("$board$", GenerateBoard(board));
        }

        private static string GenerateBoard(Board board) {
            return
                UsingsGenerator.GenerateUsings(board) +
                InterfaceGenerator.GenerateInterfaces(board) + 
                ClassGenerator.GenerateClass(board);
        }
    }
}